Report OTLP export status in startup log#6096
Conversation
Report whether the tracer exports each telemetry signal over OTLP in the "DATADOG CONFIGURATION - CORE" startup log via three boolean fields: otlp_traces_export_enabled (always false; Ruby has no OTLP trace exporter), otlp_metrics_export_enabled, and otlp_logs_export_enabled. The metrics and logs values read from the opentelemetry settings namespace, accessed defensively so an unregistered namespace defaults to false. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Typing analysisNote: Ignored files are excluded from the next sections. Untyped methodsThis PR introduces 2 untyped methods and 1 partially typed method, and clears 2 untyped methods. It increases the percentage of typed methods from 68.16% to 68.17% (+0.01%). Untyped methods (+2-2)❌ Introduced:Partially typed methods (+1-0)❌ Introduced:If you believe a method or an attribute is rightfully untyped or partially typed, you can add |
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 543d2a6 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-24 02:00:36 Comparing candidate commit 0d0274b in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d0274b526
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| # @return [Boolean] whether the tracer exports metrics over OTLP | ||
| def otlp_metrics_export_enabled | ||
| !!opentelemetry_settings&.metrics&.enabled |
There was a problem hiding this comment.
Honor disabled metrics exporter in startup status
When DD_METRICS_OTEL_ENABLED=true is combined with OTEL_METRICS_EXPORTER=none, this reports otlp_metrics_export_enabled: true, but the metrics integration explicitly skips adding an OTLP reader in that configuration (lib/datadog/opentelemetry/metrics.rb's configure_metric_reader returns when the exporter is none). The startup log is therefore misleading for a supported way to disable metrics export, so this should also require opentelemetry.metrics.exporter != "none".
Useful? React with 👍 / 👎.
|
|
||
| # @return [Boolean] whether the tracer exports logs over OTLP | ||
| def otlp_logs_export_enabled | ||
| !!opentelemetry_settings&.logs&.enabled |
There was a problem hiding this comment.
Honor disabled logs exporter in startup status
When DD_LOGS_OTEL_ENABLED=true is combined with OTEL_LOGS_EXPORTER=none, this still reports otlp_logs_export_enabled: true, even though Datadog::OpenTelemetry::Logs#configure_log_record_processor returns without configuring an OTLP processor for that exact setting. For that supported disabled-exporter configuration, the new startup field should be false rather than only reflecting the top-level enable flag.
Useful? React with 👍 / 👎.
Report otlp_metrics_export_enabled and otlp_logs_export_enabled as false when the signal's exporter is set to "none" (OTEL_METRICS_EXPORTER=none / OTEL_LOGS_EXPORTER=none). The OpenTelemetry metrics and logs configuration skips adding the OTLP reader/processor for that value even when the signal is enabled, so the startup diagnostic log should report export as disabled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What does this PR do?
Adds three boolean fields to the CORE section of the "DATADOG CONFIGURATION" startup log (
lib/datadog/core/diagnostics/environment_logger.rb):otlp_traces_export_enabledis a constantfalse: Ruby has no OTLP trace exporter, andOTEL_TRACES_EXPORTER=otlpis unsupported, so spans are always sent to Datadog in the native format.otlp_metrics_export_enabledreflectsDatadog.configuration.opentelemetry.metrics.enabled(DD_METRICS_OTEL_ENABLED).otlp_logs_export_enabledreflectsDatadog.configuration.opentelemetry.logs.enabled(DD_LOGS_OTEL_ENABLED).Specs and the RBS signature are updated to cover the new fields.
Motivation:
Part of a cross-tracer effort to report OTLP export status in the startup log using identical JSON keys across the dd-trace-* libraries.
Change log entry
None.
Additional Notes:
The metrics and logs values read from the
opentelemetrysettings namespace through a defensive helper, so a missing namespace reportsfalseinstead of raising.How to test the change?
Covered by
spec/datadog/core/diagnostics/environment_logger_spec.rb, which asserts the default state (allfalse), the metrics-enabled and logs-enabled cases, and the fallback when theopentelemetrynamespace is unavailable.Related PRs — cross-tracer OTLP startup-log effort